import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    language: 'zh'
  },
  getters: {
    getLang: state => state.language
  },
  mutations: {
    SETLANGUAGE(state, data) {
      state.language = data
      localStorage.languageType = data;
    }
  },
  actions: {
    CHANGELANGUAGE({ commit }, palyload) {
      commit('SETLANGUAGE', palyload)
    }
  }
})
